home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 25
/
Cream of the Crop 25.iso
/
bbs
/
mhis020.zip
/
CALLCRIT.MH
< prev
next >
Wrap
Text File
|
1996-09-20
|
2KB
|
68 lines
#ifndef __CALLCRIT_MH
#define __CALLCRIT_MH
#ifndef __CALLERS_MH
#include "callers.mh"
#endif
#ifndef __WILDCARD_MH
#include "wildcard.mh"
#endif
#ifndef __FINDCHAR_MH
#include "findchar.mh"
#endif
#ifndef __CALLINFO_MH
#include "callinfo.mh"
#endif
#define TITLE_WIDTH 12
#define DATA_WIDTH 14
void show_data (string: title, string: data) {
if (sys.current_col + TITLE_WIDTH + DATA_WIDTH > usr.width) {
print ('\n');
};
print (COL_CYAN, strpadleft (title + ": ", TITLE_WIDTH,' '),
COL_LMAGENTA, strpad (data, DATA_WIDTH, ' '));
}
bool meets_criteria (Ref struct _callinfo: ci, Ref struct _callcriteria: c) {
return (
matchWildcard (strupper (ci.name), strupper (c.name))
and matchWildcard (strupper (ci.city), strupper (c.city))
and ci.logon_priv >= c.min_priv
and ci.logon_priv <= c.max_priv
and (c.good_keys = "" or findAllChars (ci.logon_xkeys, strupper (c.good_keys)))
and (c.bad_keys = "" or findAnyChars (ci.logon_xkeys, strupper (c.bad_keys)))
and ci.calls >= c.min_calls
and (c.task = -1 or c.task = ci.task)
and (c.good_flags & ci.flags = c.good_flags)
and (c.bad_flags & ci.flags = 0));
}
void show_criteria (Ref struct _callcriteria: c) {
string: temp_string;
struct _stamp: temp_stamp;
show_data ("Name",c.name);
show_data ("City",c.city);
show_data ("Min priv", class_name (c.min_priv));
show_data ("Max priv", class_name (c.max_priv));
show_data ("Good keys", c.good_keys);
show_data ("Bad keys", c.bad_keys);
show_data ("Min calls", itostr (c.min_calls));
if (c.task = -1) {
temp_string := "all";
}
else temp_string := itostr (c.task);
show_data ("Task", temp_string);
show_data ("Good flags", flag_string (c.good_flags));
show_data ("Bad flags", flag_string (c.bad_flags));
print ("\n");
}
#endif